package com.crm.dao.mapper.returnMoney;

import com.crm.model.entity.finishOrderProduct.FinishOrderProduct;
import com.crm.model.qo.finishOrderProductManager.AnewSendFinishProductQO;
import com.crm.model.qo.finishOrderProductManager.FinishOrderProductQO;
import com.crm.model.vo.finishOrderProduct.AnewSendFinishProductVO;
import com.crm.model.vo.finishOrderProduct.ExportFinishOrderProductVO;
import com.crm.model.vo.finishOrderProduct.FinishOrderProductVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @Author: chaifuyou
 * @date 2021/3/26 9:26
 */
public interface ReturnMoneyFinishOrderProductMapper {

    void addFinishOrderList(@Param("finishList") List<FinishOrderProduct> finishList);

    /**
     * 查询完成订单的产品
     * @param order
     * @param qo
     * @return
     */
    List<FinishOrderProductVO> selectCustomerProductList(@Param("order") String order, @Param("qo") FinishOrderProductQO qo,@Param("dateUnit") Integer dateUnit);

    /**
     * 查询未发放提成的产品
     * @return
     */
    List<ExportFinishOrderProductVO> selectExportFinishOrderProduct(@Param("companyId") String companyId,@Param("dateUnit") Integer dateUnit);

    /**
     * 根据产品号查询当前产品录没录提成
     * @param finishOrderProductNum
     * @return
     */
    String selectOrderProductRoyaltyStatus(@Param("num") String finishOrderProductNum);

    /**
     * 根据产品号查询
     * @param finishOrderProductNum
     * @return
     */
    FinishOrderProductVO selectFinishOrderProductByNumber(@Param("num")String finishOrderProductNum);

    /**
     * 查询需要补发产品的信息
     * @param order
     * @param qo
     * @param dateUnit
     * @return
     */
    List<AnewSendFinishProductVO> selectAnewSendFinishProduct(@Param("order") String order, @Param("qo") AnewSendFinishProductQO qo, @Param("dateUnit") Integer dateUnit);

    List<FinishOrderProductVO> selectTestFinishList();

    /**
     * 查询需要同步finish表合同编号订单编号客户名称的
     * @return
     */
    List<FinishOrderProductVO> selectOrderNumberIsNull();

    /**
     * 查询订单下的finish表数据（不含赠品）
     * @param orderId
     * @return
     */
    List<FinishOrderProductVO> selectOrderFinishProduct(@Param("orderId") String orderId,@Param("type") Integer type);

    /**
     * 查询余额支付的订单下的产品（不含赠品）
     * @param customerId
     * @return
     */
    List<FinishOrderProductVO> selectBalanceOrderFinishProduct(@Param("customerId")String customerId);

    List<FinishOrderProductVO> selectFinishNumberByOrderIdAndProduct(@Param("orderId") String orderId);

    List<FinishOrderProductVO> selectFinish19(@Param("orderId") String orderId,@Param("productId") String productId);

    List<FinishOrderProductVO> selectFinish129();

    /**
     *  批量补充订单完成表客户信息(临时用补充正式库数据:customer_name为空的)
     * @param finishOrderProductList
     * @author yincuimei
     * @Date 2021-09-28
     * @return
     */
    int batchUpdateFinishOrderProductByOrderId(@Param("finishOrderProductList")List<FinishOrderProduct> finishOrderProductList);
}
